package secondweek;

import java.util.StringTokenizer;

public class reverse {
    public String rever(String yuansu,String qufen){
        StringTokenizer NUM = new StringTokenizer(yuansu, qufen);
        int number = NUM.countTokens();
        String[] reverse = new String[number];
        for(int num = 0; num < number; num++){
            reverse[num] = NUM.nextToken();
        }
        String daoxu = "";
        for(int a = 0; a < number; a++) {
            daoxu += reverse[number - a - 1] + qufen;
        }
        String result = (String) daoxu.subSequence(0,daoxu.length() - 1);
        return result;
    }
}
